package Covid2;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class CovidBean implements Writable {

    Long infect;
    Long death;

    public CovidBean() {
    }

    public CovidBean(Long infect, Long death) {
        this.infect = infect;
        this.death = death;
    }

    public Long getInfect() {
        return infect;
    }

    public void setInfect(Long infect) {
        this.infect = infect;
    }

    public Long getDeath() {
        return death;
    }

    public void setDeath(Long death) {
        this.death = death;
    }


    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeLong(infect);
        dataOutput.writeLong(death);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {

        infect = dataInput.readLong();
        death = dataInput.readLong();
    }

    @Override
    public String toString() {
        return infect+"\t"+death;
    }
}
